Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code split out web3 bundles #6623

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Code split out web3 bundles #6623

merged 1 commit into from
Feb 7, 2024

Conversation

kurtisassad
Copy link
Contributor

@kurtisassad kurtisassad commented Feb 7, 2024

Link to Issue

Closes: #6624

Description of Changes

  • Lazily load all CommunityStakes usages

stats

Before:
image

After:
image

Other considerations

This should not be viewed as a complete solution. It is only a bandaid fix on the main problem which is the ease of adding bloat to Layout.tsx. We need to establish a frontend pattern so that we don't run into this issue again.

This bandaid fix is bad in practice because it reduces code readability, but will be necessary to cut out ~30% of our initial bundle size.

@kurtisassad kurtisassad force-pushed the ka.bundlesizeFix branch 3 times, most recently from d14fa01 to 993f459 Compare February 7, 2024 18:30
@dillchen
Copy link
Contributor

dillchen commented Feb 7, 2024

@kurtisassad what's the bundle size these days for initial load, is it worse that what we had a year ago / better or worse

@kurtisassad
Copy link
Contributor Author

kurtisassad commented Feb 7, 2024

@dillchen We are slowly slipping. Half a year ago we were at 4mb
#4276 (comment)

After this PR we will be at 5mb.

Anyways the eng team have had long conversations about how we plan on fixing this in the future (Layout.tsx bloat). But as mentioned in the PR this will be a huge refactor on a legacy component, so there are no further easy wins here.

What is interesting to note is that if we were to remove the layout entirely (not a feasible solution, but gives some sense into how much bloat it adds), we would be around 3mb:

(This image is just a theoretical calculation, we can't achieve this currently)
image

@kurtisassad kurtisassad marked this pull request as ready for review February 7, 2024 18:51
Copy link
Contributor

@Rotorsoft Rotorsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dillchen
Copy link
Contributor

dillchen commented Feb 7, 2024 via email

Copy link
Contributor

@ianrowan ianrowan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jnaviask jnaviask merged commit 490134b into master Feb 7, 2024
6 of 7 checks passed
@jnaviask jnaviask deleted the ka.bundlesizeFix branch February 7, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Application performance degradation
5 participants